﻿<%@ Page Title="" Language="C#" AutoEventWireup="true" CodeBehind="Status.aspx.cs" Inherits="UCenter.Web.Views.Friend.Status" %>

<asp:content id="Content2" contentplaceholderid="head" runat="server">
 <script type="text/javascript" src="/Content/jquery.json-1.2.js"></script>
 <script type="text/javascript" src="/Content/ui.js"></script>
 <script type="text/javascript">
   $(document).ready(function(){
       $('#loadFriendImg').show();
       $.ajax({
           type:'GET',
           url:'GetFriendsStatus',
           dataType:'json',
           success:function(res){
               var data = res;  
               $('#friendList tr').remove();
               $.each(data,function(i){                   
                   var c = data[i];                  
                    $('#friendList').append("<tr><td style='padding-left:10px'><img src='"+data[i].LogoUrl+"' width='50px' height='50px'/></td><td  valign='top'><a href='javascript:void(0);'>"+data[i].TrueName+"</a>&nbsp;&nbsp;"+c.StatusSetting+"<div style='padding-top:10px'>"+getDate(c.UpdateStatusTime)+"</div></td><tr/>");              
               });             
               $('#loadFriendImg').hide();
               $('#friendList').fadeIn('fast');
           },
           error:function(){
               $('#loadFriendImg').hide();
               alert('get friend status error!');
           }
       });       
   });
   function getDate(jsondate){
      return eval("new " + jsondate.substr(1, jsondate.length - 2)).toLocaleDateString();
   }
 </script>
</asp:content>
<asp:content id="Content1" contentplaceholderid="MainContent" runat="server">
<h2><img src='/Themes/Standard/Images/ico_hy.gif' align="middle"/>好友状态</h2>
  <div class='modalMessage' id='msg' style="margin:10px;">您好友的状态更新如下：</div> 
  <img src='/Content/Images/loading.gif' id='loadFriendImg' style="display:none" /> 
  <table id='friendList' cellpadding="8" cellspacing="8" style="margin-top:5px; display:none;">              
  </table>
</asp:Content>
